<template>
	<view class="content" style="min-height: 100vh;background-color: #F2F3F5;">
		<view class="set_head">
			<image style="width: 80upx;height: 80upx;" :src="user.avatar"></image>
			<view style="margin-left: 30upx;color: #555555;">{{user.name}}</view>
		</view>
		<view class="set_item" style="margin-top: 20upx;">
			<view>反馈中心</view>
			<view>
				<uni-icon type="arrowright"></uni-icon>
			</view>
			<button class="bt" open-type="feedback"></button>
		</view>
		<view class="set_item">
			<view>授权设置</view>
			<view>
				<uni-icon type="arrowright"></uni-icon>
			</view>
			<button class="bt" open-type="openSetting"></button>
		</view>
		
		<view class="logout" @tap="logout">
			退出
		</view>
	</view>
</template>

<script>
	import uniIcon from '../../components/uni-icon.vue';
	export default{
		components:{
			uniIcon
		},
		data(){
			return{
				user:{}
			}
		},
		onLoad() {
			let s =uni.getStorageSync("user")
			this.user=JSON.parse(s)
			
		},
		methods:{
			logout(){
				uni.removeStorage({
					key:"token",
					success() {
						uni.removeStorage({
							key:"user",
							success() {
								uni.switchTab({
									url:"../home/index"
								})
							}
						})
					}
				})
			}
		}
	}
</script>

<style>
	.set_head{
		background-color: #FFFFFF;
		padding: 10upx 30upx;
	}
	.set_item{
		height: 100upx;
		width: 750upx;
		align-items: center;
		justify-content: space-between;
		padding: 0 30upx;
		box-sizing: border-box;
		background-color: #FFFFFF;
		border-bottom: 1px solid #F2F3F5;
		position: relative;
	}
	.bt{
		width: 100%;
		height: 100%;
		background-color: rgba(0,0,0,0);
		position: absolute;
		top: 0;
		left: 0;
	}
	.bt:after{
		border: none;
	}
	.logout{
		margin-top: 40upx;
		background-image: linear-gradient(to right, #FE0036,  #FF4444);
		color: #FFFFFF;
		font-size: 32upx;
		font-weight: 600;
		height: 100upx;
		align-items: center;
		justify-content: center;
		
	}
</style>
